import request from '@/utils/request'

export function getPermissionList() {
    return request({
        url: '/sys/permission'
    })
}

// 新增
export function setNewPermission(data) {
    return request({
        url: '/sys/permission',
        method: 'POST',
        data
    })
}

// 删除
export function delPermission(id) {
    return request({
        url: `/sys/permission/${id}`,
        method: 'DELETE'
    })
}

// 修改
export function updataPermission(data) {
    return request({
        url: `/sys/permission/${data.id}`,
        method: 'PUT',
        data
    })
}

// id查询
export function getByIdPermission(id) {
    return request({
        url: `/sys/permission/${id}`,
        method: 'GET'
    })
}
